package com.outstanding.ifml;

import java.util.List;

public class ItemProperty {
	
	
	// 属性的名字
	private String name;

	
	//属性的值
	private Object value;


	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}


	public Object getValue() {
		return value;
	}


	public void setValue(Object value) {
		this.value = value;
	}
	
	
	
	public String toString() {
		StringBuffer liner = new StringBuffer();
		liner.append(this.name);
		liner.append(":");
		if(this.value instanceof List) {
			
			List<String> list = (List<String>)this.value;
			liner.append("[");
			int k = 0;
			for(String str:list) {
				k++;
				liner.append("\"");
				liner.append(str);
				liner.append("\"");
				if(k <list.size()) {
					liner.append(",");
				}
			}
			liner.append("]");
		}else {
			liner.append("\"");
			liner.append(this.value);
			liner.append("\"");
		}
		return liner.toString();
	}
}
